<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="../../common/css/sapar.css" />
<link rel="stylesheet" type="text/css" href="../../common/css/common.css" />
<script type="text/javascript" src="../../common/js/jquery.js"></script>
<script type="text/javascript" src="../../common/js/sapar.js"></script>
<script type="text/javascript" src="../../common/js/WdatePicker.js"></script>

<script type="text/javascript" src="../layer/layer.js"></script>
<script type="text/javascript">
	<!--将查询的数据添加到界面的小表格 -->
	$(document).ready(function(){
		$("#sel").bind("change",function(){
			if($(this).val()==0){
				return;
			}else{
				var jsondata = [{"packageName":"大包","packageId":1},{"packageName":"小包","packageId":3},{"packageName":"中包","packageId":4}];
				$("#tbpck tbody").empty("");
				var str = '';
         		 for(var i = 0;i<jsondata.length;i++){
         			 str +='<tr><td>'+jsondata[i].packageName+'</td><td><input type="hidden" name="pid" value="'+jsondata[i].packageId+'"/><input type="text" name="pnum" value=""/><input type="hidden" name="pname" value="'+jsondata[i].packageName+'"/></td></tr>'
         		 }
         		 $("#tbpck tbody").append(str);
			}
		});
		
		
		<!-- 单击将数据返回到界面-->
		$("#baocun").click(function(){
			var index = parent.layer.getFrameIndex(window.name);
			var rtnJson = new Array();
			var parentId = parent.$("#wanglanmingcheng").val();
			alert(parentId);
			$("input[name='pnum']").each(function(){
				num = $(this).val();
				var id = $(this).prev().val();
				var name = $(this).next().val();
				if(name != ''){
					var obj = new Object();
					obj.num = id;
					obj.packName = name;
					obj.packId = id;
					rtnJson.push(obj);
				}
			});
			parent.callbackData(rtnJson);
			parent.layer.close(index);

		});
	});
	
 
</script>
</head>
<body>
<div class="tab-content-item">
                            <form name="f1" id="f1" action="?m=system&amp;c=myInfo&amp;a=updateInfo&amp;type=1" method="post">
                                <div class="kv-item clearfix">
                                    <label>包筛选(简)：</label>
                                    <div class="kv-item-content" style="line-height:30px;">
                                        <input type="text" placeholder="编号">
                                    </div>
                                </div>
                                <div class="kv-item clearfix">
                                    <label><span class="impInfo">*</span>临床科室：</label>
                                    <div class="kv-item-content">
                                        <div class="kv-item-content">
                                        <select id="sel">
                                            <option value="0">请选择科室</option>
                                            <option value="1">脑外科</option>
                                            <option value="2">内科</option>
                                            <option value="3">心脏</option>
                                            <option value="4">皮肤</option>
                                        </select>  
                                    </div>
                                    </div>
                                </div>
                                
                                <div class="table">
                    			<!--表格具体内容-->
			                    <div class="table-box" >
			                    	<table id="tbpck">
			                        	<thead>
			                                <tr>
			                                    <th>包名</th>
			                                    <th>数量</th>
			                                </tr>
			                            </thead>
			                            <tbody id="body_list">
			                            	
			                            </tbody>
			                        </table>
			                    </div>
			                    </div>
			             
                            </form>
                        </div>
                        <div class="kv-item clearfix">
                            
                            <div class="kv-item-content">
                                <a href="javascript:;" class="sapar-btn sapar-btn-recom query-btn" id="baocun">保存</a>
                            </div>
                            
                            
                        </div>
</body>
</html>